package com.tian.controller.api;

import com.tian.annotation.LoginCheckAnnotation;
import com.tian.common.CommonResult;
import com.tian.dto.UserInvitedIncomeRespDto;
import com.tian.dto.UserInvitedRespDto;
import com.tian.service.UserInviteService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * {@code @description:} 邀请用户注册接口
 *
 * @author tianwc 公众号：Java后端技术全栈
 * 在线刷题 1200+java面试题和1000+篇技术文章：<a href="https://woaijava.cc/">博客地址</a>
 * {@code @date:} 2024-12-06 16:21
 * {@code @version:} 1.0
 */
@RestController
@RequestMapping("/api/user/invite")
public class UserInviteQueryController {

    @Resource
    private UserInviteService userInviteService;
    @GetMapping("/record")
    @LoginCheckAnnotation
    public CommonResult<UserInvitedRespDto> invite() {
        return userInviteService.getInvited();
    }

    @GetMapping("/income")
    @LoginCheckAnnotation
    public CommonResult<UserInvitedIncomeRespDto> income() {
        return userInviteService.getInviteIncome();
    }
}
